/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.edu.kamai.logic.facade;

import com.edu.kamai.exception.PaperAddFailException;
import com.edu.kamai.persistence.beans.Paper;
import com.edu.kamai.persistence.dao.PaperDao;
import java.util.List;

/**
 *
 * @author xyzhu
 */
public class PaperFacade {
    public static int addOnePaper(Paper paperBean) throws PaperAddFailException{
        PaperDao paperdao = new PaperDao();
        paperdao.addPaper(paperBean);
        return 1;
    }
    
    public static List<Paper> findPaperByRoleID(int roleID){
        PaperDao paperdao = new PaperDao();
        return paperdao.findPapers(roleID);
    }
    
    public static Paper findPaperByIDAndRole(int roleID, int pid){
        PaperDao paperdao = new PaperDao();
        return paperdao.findPaperByIDAndRole(roleID, pid);
    }
    
    public static List<Paper> findPapers(){
        PaperDao paperdao = new PaperDao();
        return paperdao.findPapers();
    }
    
}
